#include <iostream>
#include <regex>
#include <string>

using namespace std;

void test1() {
  string fnames[] = {"foo.txt", "test"};
  regex txt_regex("[a-z]\\.txt");
  for (const auto &fname : fnames) {
    cout << fname << regex_match(fname, txt_regex) << endl;
  }
}

int main() { test1(); }